A5Storage::DataContainer SetItemFromFile Method
Syntax
.SetItemFromFile as L (Source as C, ContentType as C, TargetPath as C [, Offset as N [, Length as N]])
Arguments
- SourceCharacter
The file that contents are copied from.
- ContentTypeCharacter
The content type.
- TargetPathCharacter
The item in the Storage container to set the contents.
- OffsetNumeric
Default = 0. Offset into the file where copying should begin. A value of 0 will start copying at the beginning of the file.
- LengthNumeric
Default = -1. The amount of data to copy. If -1, all data is copied starting at the offset.
Returns
- ResultLogical
Returns .T. if the operation succeeds, otherwise .F. (see .CallResult for additional error information.)
Description
Copies a file to the specified Storage item..
Example
dim CallResult as CallResult dim Container as A5Storage::DataContainer = null_value() CallResult = A5Storage::DataContainer::Open(Container, "Provider='Disk';Container='c:\A5Webroot';") ? CallResult.Success = .T. ? Container.SetItemFromFile("c:\temp\MyItem.jpg", "MyItempath/MyItem.jpg") =.T.